/* 项目管理页面专用样式 */

/* 自定义变量系统 */
:root {
  /* 主题颜色 */
  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #3b82f6;
  
  /* 状态标签颜色 */
  --color-pending-bg: #f3f4f6;
  --color-pending-text: #4b5563;
  --color-progress-bg: #dbeafe;
  --color-progress-text: #2563eb;
  --color-completed-bg: #d1fae5;
  --color-completed-text: #059669;
  --color-overdue-bg: #fee2e2;
  --color-overdue-text: #dc2626;
  
  /* 中性色 */
  --color-white: #FFFFFF;
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;
  
  /* 阴影 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* 边框圆角 */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  
  /* 动画时长 */
  --transition-fast: 0.15s;
  --transition-normal: 0.3s;
  --transition-slow: 0.5s;
}

/* 卡片悬停效果 */
.card-hover {
  transition: all var(--transition-normal) ease !important;
}

.card-hover:hover {
  box-shadow: var(--shadow-xl) !important;
  transform: translateY(-2px) !important;
}

/* 搜索框样式 */
.search-bar {
  position: relative;
}

.search-bar input {
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-lg);
  padding-left: 2.5rem;
  transition: all var(--transition-normal) ease;
}

.search-bar input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  outline: none;
}

.search-bar .fa-search {
  color: var(--color-gray-400);
}

/* 按钮增强 */
.btn-primary {
  background-color: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  padding: 0.5rem 1.25rem;
  font-weight: 500;
  transition: all var(--transition-normal) ease;
  box-shadow: var(--shadow-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:focus {
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
  outline: none;
}

.btn-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 筛选面板样式 */
.filter-panel {
  background-color: var(--color-white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-gray-200);
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-normal) ease;
  height: fit-content;
  position: sticky;
  top: 1.5rem;
  display: flex;
  flex-direction: column;
}

/* 筛选面板内容区 - 确保内容充满可用空间 */
.filter-panel > *:not(.flex.space-x-3) {
  flex-shrink: 0;
}

/* 底部筛选按钮区域 - 固定在面板底部 */
.filter-panel .flex.space-x-3 {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-gray-100);
}

/* 确保主内容区域和筛选面板在lg及以上屏幕上的父容器使用flex布局 */
.flex.flex-col.lg:flex-row {
  display: flex;
  flex-wrap: wrap;
}

/* 调整筛选面板在大屏幕上的宽度和位置 */
@media (min-width: 1024px) {
  /* 筛选面板使用相对固定的宽度比例 */
  .lg:w-64.filter-panel {
    width: 260px;
    flex-shrink: 0;
  }
  
  /* 右侧内容区域占用剩余空间 */
  .flex.flex-col.lg:flex-row > div.flex-1 {
    flex-grow: 1;
    min-width: 0;
  }
}

.filter-panel.collapsed .mb-4,
.filter-panel.collapsed .mb-6,
.filter-panel.collapsed .flex.space-x-3 {
  display: none;
}

.filter-toggle {
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast) ease;
}

.filter-toggle:hover {
  background-color: var(--color-gray-100);
}

/* 统计卡片网格 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.stats-grid > div {
  background-color: var(--color-white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-gray-200);
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-normal) ease;
}

.stats-grid > div:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-2px);
}

/* 表格容器 */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

/* 项目表格样式 */
.project-table {
  min-width: 100%;
  border-collapse: collapse;
}

.project-table th {
  background-color: var(--color-gray-50);
  color: var(--color-gray-700);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1.5rem;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--color-gray-200);
}

.project-table tr {
  border-bottom: 1px solid var(--color-gray-100);
  transition: all var(--transition-fast) ease;
}

.project-table tr:hover {
  background-color: var(--color-gray-50);
  transform: scale(1.002);
  box-shadow: var(--shadow-sm);
}

.project-table tr:last-child {
  border-bottom: none;
}

.project-table td {
  padding: 1rem 1.5rem;
  vertical-align: middle;
}

/* 状态标签样式 */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge.pending {
  background-color: var(--color-pending-bg);
  color: var(--color-pending-text);
}

.status-badge.in-progress {
  background-color: var(--color-info);
  color: white;
}

.status-badge.completed {
  background-color: var(--color-success);
  color: white;
}

.status-badge.overdue {
  background-color: var(--color-danger);
  color: white;
}

/* 进度条样式 */
.progress-bar {
  background-color: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow) cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  height: 0.625rem;
}

/* 加载动画 */
.loading-spinner {
  border: 2px solid var(--color-gray-200);
  border-radius: 50%;
  border-top: 2px solid var(--color-primary);
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 通知提示样式 */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  background-color: var(--color-gray-50);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-xl);
  transform: translateX(100%);
  transition: transform var(--transition-normal) ease;
  max-width: 320px;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.notification.show {
  transform: translateX(0);
}

.notification.success {
  background-color: #F0FFF4;
  border-left: 4px solid var(--color-success);
  color: var(--color-gray-800);
}

.notification.error {
  background-color: #FFF5F5;
  border-left: 4px solid var(--color-danger);
  color: var(--color-gray-800);
}

.notification.info {
  background-color: #F0F9FF;
  border-left: 4px solid var(--color-info);
  color: var(--color-gray-800);
}

/* 空状态样式 */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--color-gray-500);
}

.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background-color: var(--color-gray-100);
  border-radius: 50%;
  margin-bottom: 1.5rem;
  color: var(--color-gray-400);
}

.empty-state h3 {
  color: var(--color-gray-800);
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.empty-state p {
  color: var(--color-gray-500);
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

/* 响应式布局调整 */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
  }
  
  .project-table th,
  .project-table td {
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .project-table {
    font-size: 0.875rem;
  }
  
  .project-table th,
  .project-table td {
    padding: 0.5rem;
  }
  
  .filter-panel {
    margin-bottom: 1rem;
    width: 100%;
    order: 2;
  }
  
  .btn-group {
    flex-direction: column;
    width: 100%;
  }
  
  .btn-group select,
  .btn-group button {
    width: 100%;
    justify-content: center;
  }
  
  .flex.flex-col.lg:flex-row {
    flex-direction: column;
  }
  
  .flex-1 {
    order: 1;
  }
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .project-table {
    min-width: 768px;
    font-size: 0.75rem;
  }
  
  .project-table th:nth-child(4),
  .project-table th:nth-child(5),
  .project-table td:nth-child(4),
  .project-table td:nth-child(5) {
    display: none;
  }
}

/* 悬停和焦点状态增强 */
button,
[type="button"],
[type="reset"],
[type="submit"],
[role="button"] {
  transition: all var(--transition-fast) ease;
}

button:active,
[type="button"]:active,
[type="reset"]:active,
[type="submit"]:active,
[role="button"]:active {
  transform: scale(0.98);
}

input:focus,
select:focus,
textarea:focus {
  transition: all var(--transition-fast) ease;
  outline: 2px solid rgba(79, 70, 229, 0.2);
  outline-offset: 2px;
  border-color: var(--color-primary);
}

/* 表格行交互增强 */
.project-table tbody tr:hover {
  background-color: rgba(79, 70, 229, 0.02);
}

/* 面包屑导航样式 */
.breadcrumbs {
  font-size: 0.875rem;
  color: var(--color-gray-600);
}

.breadcrumbs a {
  color: var(--color-gray-600);
  text-decoration: none;
  transition: color var(--transition-fast) ease;
}

.breadcrumbs a:hover {
  color: var(--color-primary);
}

.breadcrumbs .text-primary {
  color: var(--color-primary);
  font-weight: 500;
}

/* 骨架屏样式 */
.skeleton {
  background: linear-gradient(90deg, var(--color-gray-200) 25%, var(--color-gray-100) 50%, var(--color-gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-gray-100);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray-400);
  border-radius: 4px;
  transition: background-color var(--transition-fast) ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-500);
}

/* 工具提示样式 */
[title] {
  cursor: help;
}

[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--color-gray-800);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 100;
  margin-bottom: 0.25rem;
  box-shadow: var(--shadow-md);
}

[title]:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px 4px 0 4px;
  border-style: solid;
  border-color: var(--color-gray-800) transparent transparent transparent;
  z-index: 100;
}

/* 打印样式 */
@media print {
  .btn-primary,
  .delete-project-btn,
  .filter-panel,
  .pagination,
  .filter-toggle {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
  }
  
  .project-table {
    border-collapse: collapse;
    width: 100%;
  }
  
  .project-table th,
  .project-table td {
    border: 1px solid #ddd;
    padding: 0.5rem;
    background: white !important;
    color: var(--color-gray-900) !important;
  }
  
  .table-container {
    overflow: visible !important;
  }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  .project-table tr {
    border-bottom: 2px solid currentColor;
  }
  
  .card-hover {
    border: 2px solid currentColor;
  }
  
  .status-badge {
    border: 1px solid currentColor;
  }
  
  .btn-primary {
    border: 2px solid currentColor;
  }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}